﻿using STF.Blog.Common;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;


namespace STF.Blog.Model
{
    /// <summary>
    /// 用户信息表
    /// </summary>
    public class UsersInfo:BaseEntity
    {

        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "真实姓名")]
        public string RealName { get; set; }

        [Column(TypeName = "date")]
        [Display(Name = "出生日期")]
        public DateTime Birthday { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "性别")]
        public Gender Gender { get; set; }

        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "微信号")]
        public string WeChat { get; set; }

        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "手机号")]
        public string Tel { get; set; }

        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "家庭住址")]
        public string Address { get; set; }

        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "头像")]
        public string Photo { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Column(TypeName = "decimal(10,2)")]
        [Display(Name = "电子邮件")]
        public decimal Amount { get; set; }

        [ForeignKey(nameof(Users))]
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name ="用户外键")]
        public int Uid { get; set; }

        public Users Users { get; set; }
    }
}
